<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>QCNSim: QcnSim/Link.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">QCNSim
   </div>
   <div id="projectbrief">Simulator for Quake-Catcher Network</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d21be12960473ba5c51e5f9beea3525e.html">QcnSim</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Link.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_link_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_link_8h.html">Link.h</a>&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="class_link.html#ac9376c7c81beda0e397569930616ac23">   34</a></span>&#160;<a class="code" href="class_link.html#ac9376c7c81beda0e397569930616ac23">Link::Link</a>(std::shared_ptr&lt;Node&gt; nodeA, std::shared_ptr&lt;Node&gt; nodeB, <span class="keywordtype">double</span> bandwidth, <span class="keywordtype">double</span> propagationDelay, <a class="code" href="class_simulator_globals.html">SimulatorGlobals</a> &amp;<a class="code" href="class_facility.html#a04cb8b8f3d633cfcf6ba1603f5dfe7ad">simulatorGlobals</a>,</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;        <a class="code" href="class_scheduler.html">Scheduler</a> &amp;<a class="code" href="class_facility.html#a36b590795f3752bd89a4a3ec5fa1307d">scheduler</a>, <span class="keyword">const</span> std::string &amp;<a class="code" href="class_facility.html#a5967500c415fbf6b3bf420b58e645a6e">name</a>, <a class="code" href="_link_type_8h.html#a1e09bc05c5df6349a74bd3b9db638a96">LinkType</a> linkType) : nodeA(nodeA), nodeB(nodeB), bandwidth(bandwidth),</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;        propagationDelay(propagationDelay), simulatorGlobals(simulatorGlobals), scheduler(scheduler), name(name), linkType(linkType),</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;        transmissionServer(<a class="code" href="class_facility.html">Facility</a>(<span class="stringliteral">&quot;Transmission Server Original Direction&quot;</span>, simulatorGlobals, scheduler)), droppedPdusCountMedium(0) { <span class="comment">// Creates one transmission server (Facility with one server).</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <span class="comment">// If this is a duplex link, create another link object in the reverse direction, put its reference into the member variable.</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    <span class="keywordflow">if</span> (linkType == <a class="code" href="_link_type_8h.html#a1e09bc05c5df6349a74bd3b9db638a96a1077fecfb51c2f9fb873a911849f9975">LinkType::DUPLEX_LINK</a>) {</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;        <a class="code" href="class_link.html#ad088198953b55a9c6781e15dfa49ad72">reverseLink</a> = std::make_shared&lt;Link&gt;(<a class="code" href="class_link.html#ac9376c7c81beda0e397569930616ac23">Link</a>(nodeB, nodeA, bandwidth, propagationDelay, simulatorGlobals, scheduler, name, <a class="code" href="_link_type_8h.html#a1e09bc05c5df6349a74bd3b9db638a96aea1abc1cf13667617460c8e0c59c02c1">LinkType::SIMPLEX_LINK</a>));</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;        <a class="code" href="class_link.html#ad088198953b55a9c6781e15dfa49ad72">reverseLink</a>-&gt;transmissionServer.setName(<span class="stringliteral">&quot;Transmission Server Reverse Direction&quot;</span>);</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    }</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;}</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="comment">//Link::~Link() {</span></div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="comment">//}</span></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="comment">// * @brief Return reference to nodeA.</span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="comment">// *</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="comment">// * @return Reference to Node at nodeA.</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="comment">// */</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="comment">//Node &amp;Link::getnodeA() const {</span></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="comment">//  return nodeA;</span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="comment">//}</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="comment"></span><span class="comment">// * @brief Return reference to nodeA.</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="comment">// *</span></div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="comment">// * @return Reference to Node at nodeA.</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="comment">// */</span></div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="comment">//Node &amp;Link::getnodeB() const {</span></div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="comment">//  return nodeB;</span></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="comment">//}</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="class_link.html#a2cafc5931128c3a03ac50fa283e9c18f">   74</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_link.html#a2cafc5931128c3a03ac50fa283e9c18f">Link::getBandwidth</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#aff4506be6c9b62b335e3a389a01969ef">bandwidth</a>;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;}</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="class_link.html#ab6f3bcc6896090d2b0ab665c0fedbf17">   83</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_link.html#ab6f3bcc6896090d2b0ab665c0fedbf17">Link::getPropagationDelay</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#a31855f1eaf9c6562f1dc2067d475dd4d">propagationDelay</a>;</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;}</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;</div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="class_link.html#ad0d2091b3406725300be167b82216552">   92</a></span>&#160;std::string <a class="code" href="class_link.html#ad0d2091b3406725300be167b82216552">Link::getName</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#a3175152212d21764b83996c540617838">name</a>;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;}</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="class_link.html#a3f1d8f13ecc78be10812fa1d78670339">  101</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_link.html#a3f1d8f13ecc78be10812fa1d78670339">Link::isUp</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#a648c145304ac37af293458ea11f674c3">isUp</a>();</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;}</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="class_link.html#a57170d6e8669a32107794b0a2cc98890">  111</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_link.html#a57170d6e8669a32107794b0a2cc98890">Link::setUp</a>() {</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#a9cf2c05d0966a731a8a9d9157a13df5e">setUp</a>();</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="class_link.html#aa5605d4788830084dc9ca7d3e1fc418f">linkType</a> == <a class="code" href="_link_type_8h.html#a1e09bc05c5df6349a74bd3b9db638a96a1077fecfb51c2f9fb873a911849f9975">LinkType::DUPLEX_LINK</a>) {</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        <a class="code" href="class_link.html#a110ac6153337a18249b4a4197ed1a2a7">getReverseLink</a>()-&gt;setUp();</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    }</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;}</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div>
<div class="line"><a name="l00125"></a><span class="lineno"><a class="line" href="class_link.html#afe69b641a7b52cdc830307dfcd9e8af3">  125</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_link.html#afe69b641a7b52cdc830307dfcd9e8af3">Link::setDown</a>() {</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#a0f7671f75b0309c520692c2a210e734e">setDown</a>() + <a class="code" href="class_link.html#a13cc3d87988b98b33760ba3705f6bd0c">purgeInTransitQueue</a>() + ((<a class="code" href="class_link.html#aa5605d4788830084dc9ca7d3e1fc418f">linkType</a> == <a class="code" href="_link_type_8h.html#a1e09bc05c5df6349a74bd3b9db638a96a1077fecfb51c2f9fb873a911849f9975">LinkType::DUPLEX_LINK</a>) ? <a class="code" href="class_link.html#a110ac6153337a18249b4a4197ed1a2a7">getReverseLink</a>()-&gt;setDown() : 0);</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;}</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;</div>
<div class="line"><a name="l00134"></a><span class="lineno"><a class="line" href="class_link.html#abb8a206db623b733b98bb5866335b19f">  134</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_link.html#abb8a206db623b733b98bb5866335b19f">Link::getInTransitQueueSize</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#a53ed79d4f4d927e120d0cbfa00158089">inTransitQueue</a>.size();</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;}</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;</div>
<div class="line"><a name="l00170"></a><span class="lineno"><a class="line" href="class_link.html#a9600cdb73665ae77d5237abdb2ed51c3">  170</a></span>&#160;<a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83af">LinkReturnType</a> <a class="code" href="class_link.html#a9600cdb73665ae77d5237abdb2ed51c3">Link::transmitPdu</a>(<a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6fa">EventType</a> transmitEventType, <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6fa">EventType</a> endTransmitEventType, std::shared_ptr&lt;const ProtocolDataUnit&gt; pdu) {</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <span class="comment">// Consistency check. If nodes in PDU&#39;s previous and next fields are not connected by this node, then refuse transmission and return error state.</span></div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    <span class="keywordflow">if</span> (pdu-&gt;previous == <a class="code" href="class_link.html#afc5d6ab142420b803c1f9802ad0199f5">nodeA</a> &amp;&amp; pdu-&gt;next == <a class="code" href="class_link.html#af7a426a53a41d26351c85cb2cea50d60">nodeB</a>) { <span class="comment">// Forward link (this link) connects the nodes. Use it.</span></div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;        <span class="keywordtype">double</span> transmissionTime = pdu-&gt;getPduSize() * 8.0 / <a class="code" href="class_link.html#aff4506be6c9b62b335e3a389a01969ef">bandwidth</a>; <span class="comment">// Converts PDU size to bits and calculates transmission time based on bandwidth.</span></div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;        <span class="comment">// Request service for PDU at Facility (transmission server).</span></div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;        <a class="code" href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72c">FacilityReturnType</a> serviceRequestResult = <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#ad8579e469df0909ad36ee6b0719a2173">request</a>(pdu, transmitEventType);</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;        <span class="comment">// Test outcomes.</span></div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;        <span class="keywordflow">if</span> (serviceRequestResult == <a class="code" href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72ca748fbb782cdc23671570937bca42c031">FacilityReturnType::TOKEN_PUT_IN_SERVICE</a>) {</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;            <a class="code" href="class_link.html#ad60d0e445f4593579b62a3c2ecd1fa75">scheduler</a>.<a class="code" href="class_scheduler.html#ae84f19f548d606f50fba69d00fe691b1">schedule</a>(<a class="code" href="class_event.html">Event</a>(transmissionTime, endTransmitEventType, pdu)); <span class="comment">// Successful; schedule next event to release/propagate.</span></div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afacd81b4be909430d796a08b373c59d714">LinkReturnType::PDU_IN_TRANSMISSION_NEXT_EVENT_SCHEDULED</a>;</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (serviceRequestResult == <a class="code" href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72ca29752595827eef50aabead37d4eb7761">FacilityReturnType::FACILITY_BUSY_QUEUE_FULL_TOKEN_DROPPED</a>) { <span class="comment">// Facility queue full, PDU was dropped; update statistics.</span></div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;            <span class="comment">// The statistics here are controlled by the Facility class.</span></div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa9b52d9f68401bbcbaba5dc65b99898d1">LinkReturnType::LINK_BUSY_QUEUE_FULL_PDU_DROPPED</a>;</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (serviceRequestResult == <a class="code" href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72caeccec682378d2895857cde4b04dd58e1">FacilityReturnType::FACILITY_DOWN_TOKEN_DROPPED</a>) { <span class="comment">// Facility down (thus link is also down); PDU dropped, update stats of Node?</span></div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;            <span class="comment">// Statistics here are controlled by the Facility class.</span></div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa0bec40bfb1c3fa48c0a7b3b5817508f4">LinkReturnType::LINK_DOWN_PDU_DROPPED</a>;</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (serviceRequestResult == <a class="code" href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72ca9eabb9b43310855334df811fd9c79748">FacilityReturnType::FACILITY_BUSY_TOKEN_ENQUEUED</a>) { <span class="comment">// Facility busy, token enqueued. Nothing else to do.</span></div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa22ccb03889f70235c3d563f564d204c6">LinkReturnType::LINK_BUSY_PDU_ENQUEUED</a>;</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa3e860a081575fc82cc7b6ed2ca602947">LinkReturnType::NOT_IMPLEMENTED</a>; <span class="comment">// Something weird happened...</span></div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        }</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_link.html#aa5605d4788830084dc9ca7d3e1fc418f">linkType</a> == <a class="code" href="_link_type_8h.html#a1e09bc05c5df6349a74bd3b9db638a96a1077fecfb51c2f9fb873a911849f9975">LinkType::DUPLEX_LINK</a> &amp;&amp; pdu-&gt;next == <a class="code" href="class_link.html#afc5d6ab142420b803c1f9802ad0199f5">nodeA</a> &amp;&amp; pdu-&gt;previous == <a class="code" href="class_link.html#af7a426a53a41d26351c85cb2cea50d60">nodeB</a>) { <span class="comment">// The reverse link must be used for this PDU, in case of duplex links.</span></div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;        <span class="comment">// Call this function here in recursion in case of the reverse link in a duplex link.</span></div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="class_link.html#a110ac6153337a18249b4a4197ed1a2a7">getReverseLink</a>()-&gt;transmitPdu(transmitEventType, endTransmitEventType, pdu);</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;        <span class="comment">// Neither the forward, nor the reverse link connect the nodes within the PDU. Return error.</span></div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa1540ac8eab2f22bb0c7e66c69ff50dc3">LinkReturnType::ERROR_LINK_DOES_NOT_CONNECT_NODES</a>;</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    }   </div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;}</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;</div>
<div class="line"><a name="l00217"></a><span class="lineno"><a class="line" href="class_link.html#a4be56bec31ca5a278cce5c4b604b03ec">  217</a></span>&#160;<a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83af">LinkReturnType</a> <a class="code" href="class_link.html#a4be56bec31ca5a278cce5c4b604b03ec">Link::propagatePdu</a>(<a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6fa">EventType</a> nextEvent, std::shared_ptr&lt;const ProtocolDataUnit&gt; pdu) {</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    <span class="comment">// Consistency check. If nodes in PDU&#39;s previous and next fields are not connected by this node, then refuse propagation and return error state.</span></div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    <span class="keywordflow">if</span> (pdu-&gt;previous == <a class="code" href="class_link.html#afc5d6ab142420b803c1f9802ad0199f5">nodeA</a> &amp;&amp; pdu-&gt;next == <a class="code" href="class_link.html#af7a426a53a41d26351c85cb2cea50d60">nodeB</a>) { <span class="comment">// Forward link (this link) connects the nodes. Use it.</span></div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;        <span class="comment">// Release PDU from transmission Facility.</span></div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;        <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#af3c20895dff840f8db94350070360e70">release</a>(pdu);</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;        <span class="comment">// If link is down, discard PDU, update statistics.</span></div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;        <span class="keywordflow">if</span> (!<a class="code" href="class_link.html#a3f1d8f13ecc78be10812fa1d78670339">isUp</a>()) {</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;            ++<a class="code" href="class_link.html#a71c43c39d94c9b8b95d1810b5c7d17ac">droppedPdusCountMedium</a>;</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa0bec40bfb1c3fa48c0a7b3b5817508f4">LinkReturnType::LINK_DOWN_PDU_DROPPED</a>;</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;        }</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;        <span class="comment">// Otherwise, insert PDU into inTransitQueue and schedule next arrival event.</span></div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;        <a class="code" href="class_link.html#a53ed79d4f4d927e120d0cbfa00158089">inTransitQueue</a>.push_back(pdu); <span class="comment">// Insert into queue.</span></div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;        <a class="code" href="class_link.html#ad60d0e445f4593579b62a3c2ecd1fa75">scheduler</a>.<a class="code" href="class_scheduler.html#ae84f19f548d606f50fba69d00fe691b1">schedule</a>(<a class="code" href="class_event.html">Event</a>(<a class="code" href="class_link.html#a31855f1eaf9c6562f1dc2067d475dd4d">propagationDelay</a>, nextEvent, pdu));</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa546235efbb1655a5182b7eaf007ac0cc">LinkReturnType::PDU_IN_TRANSIT_NEXT_EVENT_SCHEDULED</a>;</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_link.html#aa5605d4788830084dc9ca7d3e1fc418f">linkType</a> == <a class="code" href="_link_type_8h.html#a1e09bc05c5df6349a74bd3b9db638a96a1077fecfb51c2f9fb873a911849f9975">LinkType::DUPLEX_LINK</a> &amp;&amp; pdu-&gt;next == <a class="code" href="class_link.html#afc5d6ab142420b803c1f9802ad0199f5">nodeA</a> &amp;&amp; pdu-&gt;previous == <a class="code" href="class_link.html#af7a426a53a41d26351c85cb2cea50d60">nodeB</a>) { <span class="comment">// The reverse link must be used for this PDU, in case of duplex links.</span></div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;        <span class="comment">// Call this function here in recursion for the reverse link.</span></div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="class_link.html#a110ac6153337a18249b4a4197ed1a2a7">getReverseLink</a>()-&gt;propagatePdu(nextEvent, pdu);</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;        <span class="comment">// Neither the forward, nor the reverse link connect the nodes within the PDU. Return error.</span></div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa1540ac8eab2f22bb0c7e66c69ff50dc3">LinkReturnType::ERROR_LINK_DOES_NOT_CONNECT_NODES</a>;</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;    }</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;}</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;</div>
<div class="line"><a name="l00248"></a><span class="lineno"><a class="line" href="class_link.html#aa9f5b6b14f9f191421c7e131ccb288ea">  248</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_link.html#aa9f5b6b14f9f191421c7e131ccb288ea">Link::isTransmissionServerBusy</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#a51a7f1911c56425bd1f341b3c2b005e0">isBusy</a>();</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;}</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;</div>
<div class="line"><a name="l00270"></a><span class="lineno"><a class="line" href="class_link.html#a5ea6faa515d88ae801e070291c4b917d">  270</a></span>&#160;<a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83af">LinkReturnType</a> <a class="code" href="class_link.html#a5ea6faa515d88ae801e070291c4b917d">Link::endPropagation</a>(std::shared_ptr&lt;ProtocolDataUnit&gt; pdu) {</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;    <span class="comment">// Consistency check. If nodes in PDU&#39;s previous and next fields are not connected by this node, then refuse end propagation and return error state.</span></div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    <span class="keywordflow">if</span> (pdu-&gt;previous == <a class="code" href="class_link.html#afc5d6ab142420b803c1f9802ad0199f5">nodeA</a> &amp;&amp; pdu-&gt;next == <a class="code" href="class_link.html#af7a426a53a41d26351c85cb2cea50d60">nodeB</a>) { <span class="comment">// Forward link (this link) connects the nodes. Use it.</span></div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;        <a class="code" href="class_link.html#a53ed79d4f4d927e120d0cbfa00158089">inTransitQueue</a>.remove(pdu); <span class="comment">// Removes the PDU (it should be at head of queue). If not found, does nothing. I.e., if the PDU is not really in transit here, this function will not verify it.</span></div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa5bb3aee7ae9660ee59a2daf782a4aedb">LinkReturnType::PDU_PROPAGATED</a>;</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_link.html#aa5605d4788830084dc9ca7d3e1fc418f">linkType</a> == <a class="code" href="_link_type_8h.html#a1e09bc05c5df6349a74bd3b9db638a96a1077fecfb51c2f9fb873a911849f9975">LinkType::DUPLEX_LINK</a> &amp;&amp; pdu-&gt;next == <a class="code" href="class_link.html#afc5d6ab142420b803c1f9802ad0199f5">nodeA</a> &amp;&amp; pdu-&gt;previous == <a class="code" href="class_link.html#af7a426a53a41d26351c85cb2cea50d60">nodeB</a>) { <span class="comment">// The reverse link must be used for this PDU, in case of duplex links.</span></div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;        <span class="comment">// Call this function here in recursion for the reverse link.</span></div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="class_link.html#a110ac6153337a18249b4a4197ed1a2a7">getReverseLink</a>()-&gt;endPropagation(pdu);</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;        <span class="comment">// Neither the forward, nor the reverse link connect the nodes within the PDU. Return error.</span></div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa1540ac8eab2f22bb0c7e66c69ff50dc3">LinkReturnType::ERROR_LINK_DOES_NOT_CONNECT_NODES</a>;</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;    }</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;}</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;</div>
<div class="line"><a name="l00289"></a><span class="lineno"><a class="line" href="class_link.html#a297af435322be39d8562091688c460a7">  289</a></span>&#160;std::list&lt;FacilityQueueElement&gt;::size_type <a class="code" href="class_link.html#a297af435322be39d8562091688c460a7">Link::getTransmissionQueueSize</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#a61f5bb8a3af86066d29dd2eeca3cdd84">getQueueSize</a>();</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;}</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;</div>
<div class="line"><a name="l00298"></a><span class="lineno"><a class="line" href="class_link.html#a3ae26f20287944d54c2db9d12b56f28d">  298</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_link.html#a3ae26f20287944d54c2db9d12b56f28d">Link::getMaxRecordedTransmissionQueueSize</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#a6ed30291bca3882e011216265f7d7462">getMaxRecordedQueueSize</a>();</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;}</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;</div>
<div class="line"><a name="l00307"></a><span class="lineno"><a class="line" href="class_link.html#ab93be277b905f1bd1746d649ebb4461d">  307</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_link.html#ab93be277b905f1bd1746d649ebb4461d">Link::getTransmissionQueueSizeLimit</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#ababbaa909332f3c55699721dc087f0c3">getQueueSizeLimit</a>();</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;}</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;</div>
<div class="line"><a name="l00319"></a><span class="lineno"><a class="line" href="class_link.html#af64db4e49ef26c305b301db2ae318244">  319</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_link.html#af64db4e49ef26c305b301db2ae318244">Link::setTransmissionQueueSizeLimit</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> limit) {</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;    <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#a4d8bbec743dae89da983619eedb2e129">setQueueSizeLimit</a>(limit);</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="class_link.html#aa5605d4788830084dc9ca7d3e1fc418f">linkType</a> == <a class="code" href="_link_type_8h.html#a1e09bc05c5df6349a74bd3b9db638a96a1077fecfb51c2f9fb873a911849f9975">LinkType::DUPLEX_LINK</a>) {</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;        <a class="code" href="class_link.html#a110ac6153337a18249b4a4197ed1a2a7">getReverseLink</a>()-&gt;setTransmissionQueueSizeLimit(limit);</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;    }</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;}</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;</div>
<div class="line"><a name="l00331"></a><span class="lineno"><a class="line" href="class_link.html#af485c0065bf1fdc5c296b45f6ef96fd3">  331</a></span>&#160;std::shared_ptr&lt;Node&gt; <a class="code" href="class_link.html#af485c0065bf1fdc5c296b45f6ef96fd3">Link::getNodeA</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#afc5d6ab142420b803c1f9802ad0199f5">nodeA</a>;</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;}</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;</div>
<div class="line"><a name="l00340"></a><span class="lineno"><a class="line" href="class_link.html#adb8020ddc851ceb0bf5dba01182d688c">  340</a></span>&#160;std::shared_ptr&lt;Node&gt; <a class="code" href="class_link.html#adb8020ddc851ceb0bf5dba01182d688c">Link::getNodeB</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#af7a426a53a41d26351c85cb2cea50d60">nodeB</a>;</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;}</div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;</div>
<div class="line"><a name="l00349"></a><span class="lineno"><a class="line" href="class_link.html#a4f8c266451029f36a935712f296981bd">  349</a></span>&#160;std::shared_ptr&lt;Node&gt; <a class="code" href="class_link.html#a4f8c266451029f36a935712f296981bd">Link::getSourceNode</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#af485c0065bf1fdc5c296b45f6ef96fd3">getNodeA</a>();</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;}</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;</div>
<div class="line"><a name="l00358"></a><span class="lineno"><a class="line" href="class_link.html#a61938273683eed82bfc8fff1b13d077d">  358</a></span>&#160;std::shared_ptr&lt;Node&gt; <a class="code" href="class_link.html#a61938273683eed82bfc8fff1b13d077d">Link::getDestinationNode</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#adb8020ddc851ceb0bf5dba01182d688c">getNodeB</a>();</div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;}</div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;</div>
<div class="line"><a name="l00370"></a><span class="lineno"><a class="line" href="class_link.html#a0866e5df549e6c3d83c0247d098d4ab0">  370</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_link.html#a0866e5df549e6c3d83c0247d098d4ab0">Link::getDroppedPdusCountTransmissionServer</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#ac1724d4f29211f7008a14c767f9dc359">getDroppedTokensCount</a>();</div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;}</div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;</div>
<div class="line"><a name="l00382"></a><span class="lineno"><a class="line" href="class_link.html#af5d1051d4f63ff9018fd4d6f5848dcf1">  382</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_link.html#af5d1051d4f63ff9018fd4d6f5848dcf1">Link::getDroppedPdusCountMedium</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#a71c43c39d94c9b8b95d1810b5c7d17ac">droppedPdusCountMedium</a>;</div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;}</div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;</div>
<div class="line"><a name="l00394"></a><span class="lineno"><a class="line" href="class_link.html#a194c6afd1182f7543ebd50f859b86123">  394</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_link.html#a194c6afd1182f7543ebd50f859b86123">Link::getDroppedPdusCountWholeLink</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">transmissionServer</a>.<a class="code" href="class_facility.html#ac1724d4f29211f7008a14c767f9dc359">getDroppedTokensCount</a>() + <a class="code" href="class_link.html#a71c43c39d94c9b8b95d1810b5c7d17ac">droppedPdusCountMedium</a>;</div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;}</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;</div>
<div class="line"><a name="l00403"></a><span class="lineno"><a class="line" href="class_link.html#a13cc3d87988b98b33760ba3705f6bd0c">  403</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_link.html#a13cc3d87988b98b33760ba3705f6bd0c">Link::purgeInTransitQueue</a>() {</div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;    <span class="comment">// Drop each PDU in inTransitQueue and update statistics.</span></div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> droppedPdusHere = <a class="code" href="class_link.html#a53ed79d4f4d927e120d0cbfa00158089">inTransitQueue</a>.size(); <span class="comment">// PDUs dropped from link medium, in transit queue.</span></div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;    <span class="keywordflow">while</span> (<a class="code" href="class_link.html#a53ed79d4f4d927e120d0cbfa00158089">inTransitQueue</a>.size() &gt; 0) {</div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;        <a class="code" href="class_link.html#ad60d0e445f4593579b62a3c2ecd1fa75">scheduler</a>.<a class="code" href="class_scheduler.html#ac09d9f9b4147c949268fa6bc66ced974">removeEvents</a>(<a class="code" href="class_link.html#a53ed79d4f4d927e120d0cbfa00158089">inTransitQueue</a>.front()); <span class="comment">// Delete events related to first PDU.</span></div>
<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;        <a class="code" href="class_link.html#a53ed79d4f4d927e120d0cbfa00158089">inTransitQueue</a>.pop_front(); <span class="comment">// Remove first PDU.</span></div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;    }</div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;    <a class="code" href="class_link.html#a71c43c39d94c9b8b95d1810b5c7d17ac">droppedPdusCountMedium</a> += droppedPdusHere; <span class="comment">// Update member counter for dropped PDUs in link medium.</span></div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;    <span class="keywordflow">return</span> droppedPdusHere;</div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;}</div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;</div>
<div class="line"><a name="l00419"></a><span class="lineno"><a class="line" href="class_link.html#a698315546b33a6808b37ccadeffa0d65">  419</a></span>&#160;<a class="code" href="_link_type_8h.html#a1e09bc05c5df6349a74bd3b9db638a96">LinkType</a> <a class="code" href="class_link.html#a698315546b33a6808b37ccadeffa0d65">Link::getLinkType</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_link.html#aa5605d4788830084dc9ca7d3e1fc418f">linkType</a>;</div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;}</div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;</div>
<div class="line"><a name="l00431"></a><span class="lineno"><a class="line" href="class_link.html#a110ac6153337a18249b4a4197ed1a2a7">  431</a></span>&#160;std::shared_ptr&lt;Link&gt; <a class="code" href="class_link.html#a110ac6153337a18249b4a4197ed1a2a7">Link::getReverseLink</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="class_link.html#aa5605d4788830084dc9ca7d3e1fc418f">linkType</a> == <a class="code" href="_link_type_8h.html#a1e09bc05c5df6349a74bd3b9db638a96aea1abc1cf13667617460c8e0c59c02c1">LinkType::SIMPLEX_LINK</a>) {</div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">nullptr</span>; <span class="comment">// Make sure a nullptr is returned in case of Simplex links, regardless of the contents of member reverseLink.</span></div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="class_link.html#ad088198953b55a9c6781e15dfa49ad72">reverseLink</a>;</div>
<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;    }</div>
<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;}</div>
<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;</div>
<div class="line"><a name="l00451"></a><span class="lineno"><a class="line" href="class_link.html#a8ed2e4ac2f5381d53399f8937e790b93">  451</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_link.html#a8ed2e4ac2f5381d53399f8937e790b93">Link::isNodeAlinkedToNodeB</a>(std::shared_ptr&lt;Node&gt; nodeA, std::shared_ptr&lt;Node&gt; nodeB)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;    <span class="keywordflow">return</span> (this-&gt;nodeA == nodeA &amp;&amp; this-&gt;nodeB == nodeB);</div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;}</div>
<div class="ttc" id="class_link_html_aa9f5b6b14f9f191421c7e131ccb288ea"><div class="ttname"><a href="class_link.html#aa9f5b6b14f9f191421c7e131ccb288ea">Link::isTransmissionServerBusy</a></div><div class="ttdeci">virtual bool isTransmissionServerBusy() const </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00248">Link.cpp:248</a></div></div>
<div class="ttc" id="class_link_html_a9600cdb73665ae77d5237abdb2ed51c3"><div class="ttname"><a href="class_link.html#a9600cdb73665ae77d5237abdb2ed51c3">Link::transmitPdu</a></div><div class="ttdeci">virtual LinkReturnType transmitPdu(EventType transmitEventType, EventType endTransmitEventType, std::shared_ptr&lt; const ProtocolDataUnit &gt; pdu)</div><div class="ttdoc">Requests transmission a PDU to (or through) the link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00170">Link.cpp:170</a></div></div>
<div class="ttc" id="_facility_return_type_8h_html_a4ebe26bb7c3ad3b1926de74522fcc72caeccec682378d2895857cde4b04dd58e1"><div class="ttname"><a href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72caeccec682378d2895857cde4b04dd58e1">FacilityReturnType::FACILITY_DOWN_TOKEN_DROPPED</a></div><div class="ttdoc">Facility is down. Token was dropped (or enqueued, depending on the implementation of function Facilit...</div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83af"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83af">LinkReturnType</a></div><div class="ttdeci">LinkReturnType</div><div class="ttdoc">Link Return Type enum class. </div><div class="ttdef"><b>Definition:</b> <a href="_link_return_type_8h_source.html#l00028">LinkReturnType.h:28</a></div></div>
<div class="ttc" id="_link_type_8h_html_a1e09bc05c5df6349a74bd3b9db638a96"><div class="ttname"><a href="_link_type_8h.html#a1e09bc05c5df6349a74bd3b9db638a96">LinkType</a></div><div class="ttdeci">LinkType</div><div class="ttdoc">LinkType enum class. </div><div class="ttdef"><b>Definition:</b> <a href="_link_type_8h_source.html#l00028">LinkType.h:28</a></div></div>
<div class="ttc" id="class_link_html_a61938273683eed82bfc8fff1b13d077d"><div class="ttname"><a href="class_link.html#a61938273683eed82bfc8fff1b13d077d">Link::getDestinationNode</a></div><div class="ttdeci">virtual std::shared_ptr&lt; Node &gt; getDestinationNode() const </div><div class="ttdoc">Return pointer to nodeB, the Destination node of a Simplex link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00358">Link.cpp:358</a></div></div>
<div class="ttc" id="class_link_html_a5ea6faa515d88ae801e070291c4b917d"><div class="ttname"><a href="class_link.html#a5ea6faa515d88ae801e070291c4b917d">Link::endPropagation</a></div><div class="ttdeci">virtual LinkReturnType endPropagation(std::shared_ptr&lt; ProtocolDataUnit &gt; pdu)</div><div class="ttdoc">PDU has successfully propagated through the link; end propagation. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00270">Link.cpp:270</a></div></div>
<div class="ttc" id="class_link_html_a8ed2e4ac2f5381d53399f8937e790b93"><div class="ttname"><a href="class_link.html#a8ed2e4ac2f5381d53399f8937e790b93">Link::isNodeAlinkedToNodeB</a></div><div class="ttdeci">virtual bool isNodeAlinkedToNodeB(std::shared_ptr&lt; Node &gt; nodeA, std::shared_ptr&lt; Node &gt; nodeB) const </div><div class="ttdoc">Verifies whether this link connects parameter nodeA and nodeB. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00451">Link.cpp:451</a></div></div>
<div class="ttc" id="_event_type_8h_html_a2628ea8d12e8b2563c32f05dc7fff6fa"><div class="ttname"><a href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6fa">EventType</a></div><div class="ttdeci">EventType</div><div class="ttdoc">EventType enum class. </div><div class="ttdef"><b>Definition:</b> <a href="_event_type_8h_source.html#l00029">EventType.h:29</a></div></div>
<div class="ttc" id="class_link_html_af5d1051d4f63ff9018fd4d6f5848dcf1"><div class="ttname"><a href="class_link.html#af5d1051d4f63ff9018fd4d6f5848dcf1">Link::getDroppedPdusCountMedium</a></div><div class="ttdeci">virtual unsigned int getDroppedPdusCountMedium() const </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00382">Link.cpp:382</a></div></div>
<div class="ttc" id="class_link_html_a2cafc5931128c3a03ac50fa283e9c18f"><div class="ttname"><a href="class_link.html#a2cafc5931128c3a03ac50fa283e9c18f">Link::getBandwidth</a></div><div class="ttdeci">virtual double getBandwidth() const </div><div class="ttdoc">Destructor. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00074">Link.cpp:74</a></div></div>
<div class="ttc" id="class_scheduler_html"><div class="ttname"><a href="class_scheduler.html">Scheduler</a></div><div class="ttdoc">Scheduler class. </div><div class="ttdef"><b>Definition:</b> <a href="_scheduler_8h_source.html#l00058">Scheduler.h:58</a></div></div>
<div class="ttc" id="class_link_html_ad0d2091b3406725300be167b82216552"><div class="ttname"><a href="class_link.html#ad0d2091b3406725300be167b82216552">Link::getName</a></div><div class="ttdeci">virtual std::string getName() const </div><div class="ttdoc">Return name of link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00092">Link.cpp:92</a></div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83afa9b52d9f68401bbcbaba5dc65b99898d1"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa9b52d9f68401bbcbaba5dc65b99898d1">LinkReturnType::LINK_BUSY_QUEUE_FULL_PDU_DROPPED</a></div><div class="ttdoc">The queue is full (has reached the imposed limit); PDU for which service was requested was dropped...</div></div>
<div class="ttc" id="class_event_html"><div class="ttname"><a href="class_event.html">Event</a></div><div class="ttdoc">Event class. </div><div class="ttdef"><b>Definition:</b> <a href="_event_8h_source.html#l00035">Event.h:35</a></div></div>
<div class="ttc" id="class_link_html_af64db4e49ef26c305b301db2ae318244"><div class="ttname"><a href="class_link.html#af64db4e49ef26c305b301db2ae318244">Link::setTransmissionQueueSizeLimit</a></div><div class="ttdeci">virtual void setTransmissionQueueSizeLimit(unsigned int limit)</div><div class="ttdoc">Set transmission (Facility) queue size limit (for both forward and reverse links in case of duplex li...</div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00319">Link.cpp:319</a></div></div>
<div class="ttc" id="class_facility_html_a61f5bb8a3af86066d29dd2eeca3cdd84"><div class="ttname"><a href="class_facility.html#a61f5bb8a3af86066d29dd2eeca3cdd84">Facility::getQueueSize</a></div><div class="ttdeci">std::list&lt; FacilityQueueElement &gt;::size_type getQueueSize() const </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00721">Facility.cpp:721</a></div></div>
<div class="ttc" id="class_link_html_aa5605d4788830084dc9ca7d3e1fc418f"><div class="ttname"><a href="class_link.html#aa5605d4788830084dc9ca7d3e1fc418f">Link::linkType</a></div><div class="ttdeci">LinkType linkType</div><div class="ttdoc">Type of link (typically Simplex or Duplex). </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00081">Link.h:81</a></div></div>
<div class="ttc" id="class_facility_html_ac1724d4f29211f7008a14c767f9dc359"><div class="ttname"><a href="class_facility.html#ac1724d4f29211f7008a14c767f9dc359">Facility::getDroppedTokensCount</a></div><div class="ttdeci">unsigned int getDroppedTokensCount() const </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00907">Facility.cpp:907</a></div></div>
<div class="ttc" id="class_link_html_af485c0065bf1fdc5c296b45f6ef96fd3"><div class="ttname"><a href="class_link.html#af485c0065bf1fdc5c296b45f6ef96fd3">Link::getNodeA</a></div><div class="ttdeci">virtual std::shared_ptr&lt; Node &gt; getNodeA() const </div><div class="ttdoc">Return pointer to nodeA (one side of link). </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00331">Link.cpp:331</a></div></div>
<div class="ttc" id="class_link_html_a4be56bec31ca5a278cce5c4b604b03ec"><div class="ttname"><a href="class_link.html#a4be56bec31ca5a278cce5c4b604b03ec">Link::propagatePdu</a></div><div class="ttdeci">virtual LinkReturnType propagatePdu(EventType nextEvent, std::shared_ptr&lt; const ProtocolDataUnit &gt; pdu)</div><div class="ttdoc">Ends transmission (release PDU from Facility) and propagate PDU through this link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00217">Link.cpp:217</a></div></div>
<div class="ttc" id="_link_type_8h_html_a1e09bc05c5df6349a74bd3b9db638a96a1077fecfb51c2f9fb873a911849f9975"><div class="ttname"><a href="_link_type_8h.html#a1e09bc05c5df6349a74bd3b9db638a96a1077fecfb51c2f9fb873a911849f9975">LinkType::DUPLEX_LINK</a></div><div class="ttdoc">Two-way, bidirectional link betwen to nodes. </div></div>
<div class="ttc" id="class_facility_html_a5967500c415fbf6b3bf420b58e645a6e"><div class="ttname"><a href="class_facility.html#a5967500c415fbf6b3bf420b58e645a6e">Facility::name</a></div><div class="ttdeci">std::string name</div><div class="ttdoc">Facility name. </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8h_source.html#l00046">Facility.h:46</a></div></div>
<div class="ttc" id="class_facility_html_a51a7f1911c56425bd1f341b3c2b005e0"><div class="ttname"><a href="class_facility.html#a51a7f1911c56425bd1f341b3c2b005e0">Facility::isBusy</a></div><div class="ttdeci">bool isBusy() const </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00624">Facility.cpp:624</a></div></div>
<div class="ttc" id="class_link_html_a194c6afd1182f7543ebd50f859b86123"><div class="ttname"><a href="class_link.html#a194c6afd1182f7543ebd50f859b86123">Link::getDroppedPdusCountWholeLink</a></div><div class="ttdeci">virtual unsigned int getDroppedPdusCountWholeLink() const </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00394">Link.cpp:394</a></div></div>
<div class="ttc" id="class_link_html_a0866e5df549e6c3d83c0247d098d4ab0"><div class="ttname"><a href="class_link.html#a0866e5df549e6c3d83c0247d098d4ab0">Link::getDroppedPdusCountTransmissionServer</a></div><div class="ttdeci">virtual unsigned int getDroppedPdusCountTransmissionServer() const </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00370">Link.cpp:370</a></div></div>
<div class="ttc" id="class_facility_html_af3c20895dff840f8db94350070360e70"><div class="ttname"><a href="class_facility.html#af3c20895dff840f8db94350070360e70">Facility::release</a></div><div class="ttdeci">FacilityReturnType release(std::shared_ptr&lt; const Token &gt; token)</div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00584">Facility.cpp:584</a></div></div>
<div class="ttc" id="class_link_html_afc5d6ab142420b803c1f9802ad0199f5"><div class="ttname"><a href="class_link.html#afc5d6ab142420b803c1f9802ad0199f5">Link::nodeA</a></div><div class="ttdeci">std::shared_ptr&lt; Node &gt; nodeA</div><div class="ttdoc">Node at one side of the link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00071">Link.h:71</a></div></div>
<div class="ttc" id="class_link_html_a57170d6e8669a32107794b0a2cc98890"><div class="ttname"><a href="class_link.html#a57170d6e8669a32107794b0a2cc98890">Link::setUp</a></div><div class="ttdeci">virtual void setUp()</div><div class="ttdoc">Set Link up (in both directions in case of duplex links). </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00111">Link.cpp:111</a></div></div>
<div class="ttc" id="_link_8h_html"><div class="ttname"><a href="_link_8h.html">Link.h</a></div></div>
<div class="ttc" id="class_facility_html_a04cb8b8f3d633cfcf6ba1603f5dfe7ad"><div class="ttname"><a href="class_facility.html#a04cb8b8f3d633cfcf6ba1603f5dfe7ad">Facility::simulatorGlobals</a></div><div class="ttdeci">SimulatorGlobals &amp; simulatorGlobals</div><div class="ttdoc">Reference to SimulatorGlobals object (typically used to fetch the current clock time). </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8h_source.html#l00065">Facility.h:65</a></div></div>
<div class="ttc" id="class_link_html_afe69b641a7b52cdc830307dfcd9e8af3"><div class="ttname"><a href="class_link.html#afe69b641a7b52cdc830307dfcd9e8af3">Link::setDown</a></div><div class="ttdeci">virtual unsigned int setDown()</div><div class="ttdoc">Set Link down (in both directions in case of duplex links). </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00125">Link.cpp:125</a></div></div>
<div class="ttc" id="class_scheduler_html_ac09d9f9b4147c949268fa6bc66ced974"><div class="ttname"><a href="class_scheduler.html#ac09d9f9b4147c949268fa6bc66ced974">Scheduler::removeEvents</a></div><div class="ttdeci">unsigned int removeEvents(std::shared_ptr&lt; const Entity &gt; entity)</div><div class="ttdoc">Removes events from Event Chain that contains a matching entity in the Event object. </div><div class="ttdef"><b>Definition:</b> <a href="_scheduler_8cpp_source.html#l00117">Scheduler.cpp:117</a></div></div>
<div class="ttc" id="class_link_html_a53ed79d4f4d927e120d0cbfa00158089"><div class="ttname"><a href="class_link.html#a53ed79d4f4d927e120d0cbfa00158089">Link::inTransitQueue</a></div><div class="ttdeci">std::list&lt; std::shared_ptr&lt; const ProtocolDataUnit &gt; &gt; inTransitQueue</div><div class="ttdoc">Queue for PDUs in transit (in propagation) in this link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00076">Link.h:76</a></div></div>
<div class="ttc" id="class_facility_html_a9cf2c05d0966a731a8a9d9157a13df5e"><div class="ttname"><a href="class_facility.html#a9cf2c05d0966a731a8a9d9157a13df5e">Facility::setUp</a></div><div class="ttdeci">void setUp()</div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00697">Facility.cpp:697</a></div></div>
<div class="ttc" id="class_link_html_ac9376c7c81beda0e397569930616ac23"><div class="ttname"><a href="class_link.html#ac9376c7c81beda0e397569930616ac23">Link::Link</a></div><div class="ttdeci">Link(std::shared_ptr&lt; Node &gt; nodeA, std::shared_ptr&lt; Node &gt; nodeB, double bandwidth, double propagationDelay, SimulatorGlobals &amp;simulatorGlobals, Scheduler &amp;scheduler, const std::string &amp;name=&quot;&quot;, LinkType linkType=LinkType::SIMPLEX_LINK)</div><div class="ttdoc">Default constructor. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00034">Link.cpp:34</a></div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83afa5bb3aee7ae9660ee59a2daf782a4aedb"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa5bb3aee7ae9660ee59a2daf782a4aedb">LinkReturnType::PDU_PROPAGATED</a></div><div class="ttdoc">PDU has been propagated (transited) through the link medium and removed from inTransitQueue (if PDU w...</div></div>
<div class="ttc" id="class_link_html_abe44953f8653b44f2b914daa0bb6bcdc"><div class="ttname"><a href="class_link.html#abe44953f8653b44f2b914daa0bb6bcdc">Link::transmissionServer</a></div><div class="ttdeci">Facility transmissionServer</div><div class="ttdoc">Transmission server for this Link (one-way). </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00079">Link.h:79</a></div></div>
<div class="ttc" id="class_scheduler_html_ae84f19f548d606f50fba69d00fe691b1"><div class="ttname"><a href="class_scheduler.html#ae84f19f548d606f50fba69d00fe691b1">Scheduler::schedule</a></div><div class="ttdeci">void schedule(const Event &amp;event)</div><div class="ttdef"><b>Definition:</b> <a href="_scheduler_8cpp_source.html#l00056">Scheduler.cpp:56</a></div></div>
<div class="ttc" id="class_link_html_a3175152212d21764b83996c540617838"><div class="ttname"><a href="class_link.html#a3175152212d21764b83996c540617838">Link::name</a></div><div class="ttdeci">std::string name</div><div class="ttdoc">Name of this link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00075">Link.h:75</a></div></div>
<div class="ttc" id="class_link_html_ab93be277b905f1bd1746d649ebb4461d"><div class="ttname"><a href="class_link.html#ab93be277b905f1bd1746d649ebb4461d">Link::getTransmissionQueueSizeLimit</a></div><div class="ttdeci">virtual unsigned int getTransmissionQueueSizeLimit() const </div><div class="ttdoc">Get transmission (Facility) queue size limit. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00307">Link.cpp:307</a></div></div>
<div class="ttc" id="_facility_return_type_8h_html_a4ebe26bb7c3ad3b1926de74522fcc72ca29752595827eef50aabead37d4eb7761"><div class="ttname"><a href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72ca29752595827eef50aabead37d4eb7761">FacilityReturnType::FACILITY_BUSY_QUEUE_FULL_TOKEN_DROPPED</a></div><div class="ttdoc">The queue is full (has reached the imposed limit); token for which service was requested was dropped...</div></div>
<div class="ttc" id="class_link_html_a3f1d8f13ecc78be10812fa1d78670339"><div class="ttname"><a href="class_link.html#a3f1d8f13ecc78be10812fa1d78670339">Link::isUp</a></div><div class="ttdeci">virtual bool isUp() const </div><div class="ttdoc">Return true if link is up; false otherwise. This status is the direct status of underlying Facility...</div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00101">Link.cpp:101</a></div></div>
<div class="ttc" id="class_link_html_ab6f3bcc6896090d2b0ab665c0fedbf17"><div class="ttname"><a href="class_link.html#ab6f3bcc6896090d2b0ab665c0fedbf17">Link::getPropagationDelay</a></div><div class="ttdeci">virtual double getPropagationDelay() const </div><div class="ttdoc">Return propagation delay or latency of link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00083">Link.cpp:83</a></div></div>
<div class="ttc" id="class_facility_html_ad8579e469df0909ad36ee6b0719a2173"><div class="ttname"><a href="class_facility.html#ad8579e469df0909ad36ee6b0719a2173">Facility::request</a></div><div class="ttdeci">FacilityReturnType request(std::shared_ptr&lt; const Token &gt; token, EventType eventType)</div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00229">Facility.cpp:229</a></div></div>
<div class="ttc" id="class_link_html_a4f8c266451029f36a935712f296981bd"><div class="ttname"><a href="class_link.html#a4f8c266451029f36a935712f296981bd">Link::getSourceNode</a></div><div class="ttdeci">virtual std::shared_ptr&lt; Node &gt; getSourceNode() const </div><div class="ttdoc">Return pointer to nodeA, the Source node of a Simplex link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00349">Link.cpp:349</a></div></div>
<div class="ttc" id="_facility_return_type_8h_html_a4ebe26bb7c3ad3b1926de74522fcc72ca748fbb782cdc23671570937bca42c031"><div class="ttname"><a href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72ca748fbb782cdc23671570937bca42c031">FacilityReturnType::TOKEN_PUT_IN_SERVICE</a></div><div class="ttdoc">Token was successfuly put in service by facility. </div></div>
<div class="ttc" id="class_link_html_a71c43c39d94c9b8b95d1810b5c7d17ac"><div class="ttname"><a href="class_link.html#a71c43c39d94c9b8b95d1810b5c7d17ac">Link::droppedPdusCountMedium</a></div><div class="ttdeci">unsigned int droppedPdusCountMedium</div><div class="ttdoc">Count of dropped PDUs by this link&amp;#39;s medium. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00080">Link.h:80</a></div></div>
<div class="ttc" id="class_link_html_a297af435322be39d8562091688c460a7"><div class="ttname"><a href="class_link.html#a297af435322be39d8562091688c460a7">Link::getTransmissionQueueSize</a></div><div class="ttdeci">virtual std::list&lt; FacilityQueueElement &gt;::size_type getTransmissionQueueSize() const </div><div class="ttdoc">Get transmission (Facility) queue size. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00289">Link.cpp:289</a></div></div>
<div class="ttc" id="class_link_html_af7a426a53a41d26351c85cb2cea50d60"><div class="ttname"><a href="class_link.html#af7a426a53a41d26351c85cb2cea50d60">Link::nodeB</a></div><div class="ttdeci">std::shared_ptr&lt; Node &gt; nodeB</div><div class="ttdoc">Node at the other side of the link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00072">Link.h:72</a></div></div>
<div class="ttc" id="class_facility_html_a6ed30291bca3882e011216265f7d7462"><div class="ttname"><a href="class_facility.html#a6ed30291bca3882e011216265f7d7462">Facility::getMaxRecordedQueueSize</a></div><div class="ttdeci">unsigned int getMaxRecordedQueueSize() const </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00812">Facility.cpp:812</a></div></div>
<div class="ttc" id="class_facility_html"><div class="ttname"><a href="class_facility.html">Facility</a></div><div class="ttdoc">Facility class. </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8h_source.html#l00044">Facility.h:44</a></div></div>
<div class="ttc" id="class_link_html_ad088198953b55a9c6781e15dfa49ad72"><div class="ttname"><a href="class_link.html#ad088198953b55a9c6781e15dfa49ad72">Link::reverseLink</a></div><div class="ttdeci">std::shared_ptr&lt; Link &gt; reverseLink</div><div class="ttdoc">Contains the pointer for the link in the reverse direction in case of Duplex links. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00082">Link.h:82</a></div></div>
<div class="ttc" id="class_facility_html_a0f7671f75b0309c520692c2a210e734e"><div class="ttname"><a href="class_facility.html#a0f7671f75b0309c520692c2a210e734e">Facility::setDown</a></div><div class="ttdeci">unsigned int setDown()</div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00709">Facility.cpp:709</a></div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83afa3e860a081575fc82cc7b6ed2ca602947"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa3e860a081575fc82cc7b6ed2ca602947">LinkReturnType::NOT_IMPLEMENTED</a></div><div class="ttdoc">This function has not been implemented yet. </div></div>
<div class="ttc" id="class_link_html_adb8020ddc851ceb0bf5dba01182d688c"><div class="ttname"><a href="class_link.html#adb8020ddc851ceb0bf5dba01182d688c">Link::getNodeB</a></div><div class="ttdeci">virtual std::shared_ptr&lt; Node &gt; getNodeB() const </div><div class="ttdoc">Return pointer to nodeB (another side of link). </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00340">Link.cpp:340</a></div></div>
<div class="ttc" id="class_link_html_a31855f1eaf9c6562f1dc2067d475dd4d"><div class="ttname"><a href="class_link.html#a31855f1eaf9c6562f1dc2067d475dd4d">Link::propagationDelay</a></div><div class="ttdeci">double propagationDelay</div><div class="ttdoc">Propagation delay of this link, which is medium-dependent, typically in seconds. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00074">Link.h:74</a></div></div>
<div class="ttc" id="class_simulator_globals_html"><div class="ttname"><a href="class_simulator_globals.html">SimulatorGlobals</a></div><div class="ttdoc">Simulator-scope variables and parameters. </div><div class="ttdef"><b>Definition:</b> <a href="_simulator_globals_8h_source.html#l00158">SimulatorGlobals.h:158</a></div></div>
<div class="ttc" id="class_link_html_a3ae26f20287944d54c2db9d12b56f28d"><div class="ttname"><a href="class_link.html#a3ae26f20287944d54c2db9d12b56f28d">Link::getMaxRecordedTransmissionQueueSize</a></div><div class="ttdeci">virtual unsigned int getMaxRecordedTransmissionQueueSize() const </div><div class="ttdoc">Get transmission (Facility) max recorded queue size. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00298">Link.cpp:298</a></div></div>
<div class="ttc" id="class_link_html_a698315546b33a6808b37ccadeffa0d65"><div class="ttname"><a href="class_link.html#a698315546b33a6808b37ccadeffa0d65">Link::getLinkType</a></div><div class="ttdeci">virtual LinkType getLinkType() const </div><div class="ttdoc">Get LinkType (type of link) of this link. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00419">Link.cpp:419</a></div></div>
<div class="ttc" id="class_link_html_ad60d0e445f4593579b62a3c2ecd1fa75"><div class="ttname"><a href="class_link.html#ad60d0e445f4593579b62a3c2ecd1fa75">Link::scheduler</a></div><div class="ttdeci">Scheduler &amp; scheduler</div><div class="ttdoc">Reference to Scheduler object. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00078">Link.h:78</a></div></div>
<div class="ttc" id="class_link_html_a13cc3d87988b98b33760ba3705f6bd0c"><div class="ttname"><a href="class_link.html#a13cc3d87988b98b33760ba3705f6bd0c">Link::purgeInTransitQueue</a></div><div class="ttdeci">unsigned int purgeInTransitQueue()</div><div class="ttdoc">Purge inTransitQueue, update statistics, return number of dropped PDUs from link medium. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00403">Link.cpp:403</a></div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83afa22ccb03889f70235c3d563f564d204c6"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa22ccb03889f70235c3d563f564d204c6">LinkReturnType::LINK_BUSY_PDU_ENQUEUED</a></div><div class="ttdoc">Link (transmission server) was busy; PDU was enqueued. </div></div>
<div class="ttc" id="class_facility_html_a36b590795f3752bd89a4a3ec5fa1307d"><div class="ttname"><a href="class_facility.html#a36b590795f3752bd89a4a3ec5fa1307d">Facility::scheduler</a></div><div class="ttdeci">Scheduler &amp; scheduler</div><div class="ttdoc">Reference to Scheduler object, such that dequeued tokens can be rescheduled. </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8h_source.html#l00066">Facility.h:66</a></div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83afa546235efbb1655a5182b7eaf007ac0cc"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa546235efbb1655a5182b7eaf007ac0cc">LinkReturnType::PDU_IN_TRANSIT_NEXT_EVENT_SCHEDULED</a></div><div class="ttdoc">PDU is in transit within link medium (and within inTransitQueue). </div></div>
<div class="ttc" id="class_facility_html_a4d8bbec743dae89da983619eedb2e129"><div class="ttname"><a href="class_facility.html#a4d8bbec743dae89da983619eedb2e129">Facility::setQueueSizeLimit</a></div><div class="ttdeci">void setQueueSizeLimit(unsigned int limit)</div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00936">Facility.cpp:936</a></div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83afa1540ac8eab2f22bb0c7e66c69ff50dc3"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa1540ac8eab2f22bb0c7e66c69ff50dc3">LinkReturnType::ERROR_LINK_DOES_NOT_CONNECT_NODES</a></div><div class="ttdoc">The nodes within PDU&amp;#39;s previous and next fields are not connected through this link. PDU cannot travel here (inconsistency). </div></div>
<div class="ttc" id="class_link_html_aff4506be6c9b62b335e3a389a01969ef"><div class="ttname"><a href="class_link.html#aff4506be6c9b62b335e3a389a01969ef">Link::bandwidth</a></div><div class="ttdeci">double bandwidth</div><div class="ttdoc">Bandwidth of this link, typically in bits per second. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00073">Link.h:73</a></div></div>
<div class="ttc" id="class_link_html_abb8a206db623b733b98bb5866335b19f"><div class="ttname"><a href="class_link.html#abb8a206db623b733b98bb5866335b19f">Link::getInTransitQueueSize</a></div><div class="ttdeci">virtual std::list&lt; std::shared_ptr&lt; const ProtocolDataUnit &gt; &gt;::size_type getInTransitQueueSize() const </div><div class="ttdoc">Get current PDU in-transit queue size. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00134">Link.cpp:134</a></div></div>
<div class="ttc" id="class_facility_html_a648c145304ac37af293458ea11f674c3"><div class="ttname"><a href="class_facility.html#a648c145304ac37af293458ea11f674c3">Facility::isUp</a></div><div class="ttdeci">bool isUp() const </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00681">Facility.cpp:681</a></div></div>
<div class="ttc" id="_facility_return_type_8h_html_a4ebe26bb7c3ad3b1926de74522fcc72ca9eabb9b43310855334df811fd9c79748"><div class="ttname"><a href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72ca9eabb9b43310855334df811fd9c79748">FacilityReturnType::FACILITY_BUSY_TOKEN_ENQUEUED</a></div><div class="ttdoc">Facility was busy; token was enqueued. </div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83afacd81b4be909430d796a08b373c59d714"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afacd81b4be909430d796a08b373c59d714">LinkReturnType::PDU_IN_TRANSMISSION_NEXT_EVENT_SCHEDULED</a></div><div class="ttdoc">PDU was successfully put into transmission (serviced) at Link. </div></div>
<div class="ttc" id="class_facility_html_ababbaa909332f3c55699721dc087f0c3"><div class="ttname"><a href="class_facility.html#ababbaa909332f3c55699721dc087f0c3">Facility::getQueueSizeLimit</a></div><div class="ttdeci">unsigned int getQueueSizeLimit() const </div><div class="ttdef"><b>Definition:</b> <a href="_facility_8cpp_source.html#l00950">Facility.cpp:950</a></div></div>
<div class="ttc" id="_link_return_type_8h_html_a554ed4dd9752dfafac386b42493b83afa0bec40bfb1c3fa48c0a7b3b5817508f4"><div class="ttname"><a href="_link_return_type_8h.html#a554ed4dd9752dfafac386b42493b83afa0bec40bfb1c3fa48c0a7b3b5817508f4">LinkReturnType::LINK_DOWN_PDU_DROPPED</a></div><div class="ttdoc">Link is down. PDU was dropped (or enqueued, depending on the implementation of function Facility::req...</div></div>
<div class="ttc" id="_facility_return_type_8h_html_a4ebe26bb7c3ad3b1926de74522fcc72c"><div class="ttname"><a href="_facility_return_type_8h.html#a4ebe26bb7c3ad3b1926de74522fcc72c">FacilityReturnType</a></div><div class="ttdeci">FacilityReturnType</div><div class="ttdoc">Facility Return Type enum class. </div><div class="ttdef"><b>Definition:</b> <a href="_facility_return_type_8h_source.html#l00028">FacilityReturnType.h:28</a></div></div>
<div class="ttc" id="class_link_html_a110ac6153337a18249b4a4197ed1a2a7"><div class="ttname"><a href="class_link.html#a110ac6153337a18249b4a4197ed1a2a7">Link::getReverseLink</a></div><div class="ttdeci">virtual std::shared_ptr&lt; Link &gt; getReverseLink() const </div><div class="ttdoc">Get ReverseLink reference. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8cpp_source.html#l00431">Link.cpp:431</a></div></div>
<div class="ttc" id="_link_type_8h_html_a1e09bc05c5df6349a74bd3b9db638a96aea1abc1cf13667617460c8e0c59c02c1"><div class="ttname"><a href="_link_type_8h.html#a1e09bc05c5df6349a74bd3b9db638a96aea1abc1cf13667617460c8e0c59c02c1">LinkType::SIMPLEX_LINK</a></div><div class="ttdoc">One-way link between two nodes. </div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Jan 6 2014 12:30:37 for QCNSim by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
